TRANSFERRING FILES TO/FROM PEGASUS

The mail server provides you with the capability to transfer files between it and your own computer or other computers on or off campus. This is so you can upload and download files, mail notebooks, or message text to e-mail to other users.

Normally, when transferring a file to the mail server If, however, the recipient of the message has a mail reader like PINE that supports MIME attachments, you can transfer the file to the mail server in binary mode and "attach"it to a text message. Using MIME, PINE will encode the binary file so that it can be transferred via e-mail.

The method for transferring files to or from the mail server depends upon how you access the mail server. If you are accessing the mail server from a computer connected to the Internet, you can use FTP file transfer. If you are dialing in to the mail server via a modem or a ROLM Dataphone, you can use Kermit or ZMODEM file transfer, whichever one your emulation package supports.

TEXT (ASCII) VERSES BINARY FILES


When you are downloading files (either via FTP or a phone modem), there are two different types you may encounter: plain text (or ASCII) files and binary files. Plain text files are human readable files; as soon as you download them, you can view them on the screen. Binary files are typically executable programs, sound or picture files, or compressed files. If you attempt to read them on the screen, you will see nothing but garbage (and you could lock up your computer).

The difficulty lies in telling the two file types apart. The best clue is to look at the file type or extension. Most file names you see will follow the DOS naming convention of an eight character file name, followed by a period, and followed by a three character extension. However, you may see file names, in particular UNIX files, that can be longer and have multiple parts to them. Here are some common extensions you may see:

Text (ASCII) files: asc, doc, htm, html, read.me, txt
Binary files: compressed files (arc, gz, tar, zip, Z)
movies(avi, mov, mpg, mpeg, qt)
picture(bmp, gif, jpg, tif)
sound(aiff, au, mid, midi, wav)
programs, libraries (com, dll, exe)

The above list is not meant to be exhaustive. As new software is made available, you may see other types of file extensions. If you are not sure what type of file you are dealing with, try downloading it as a binary file first. Binary transfer mode will also successfully transfer text files in most cases. If a file turns out to be a text file and binary transfer mode made it look funny, you can switch to text mode and download the file again.

TRANSFERRING FILES VIA FTP

General Information About Transferring Files

File transfer on the Internet is accomplished with a method know as the File Transfer Protocol (FTP). With this method, you log on to a remote system and then use a series of commands (namely cd, get, and put) to transfer files. Normally you need to have an account on the remote system, however many sites on the Internet support what is known as 'Anonymous FTP'. What this means is that you can FTP to a remote system without need for an account on that system. Instead when prompted, you provide a username of anonymous and supply your Pegasus electronic mailing address for the password. The sites that support Anonymous FTP often have public directories of programs or documents you can download.

Once you connect to a particular machine, you need to change to the directory where you wish to upload to/download from using the cd (change directory) command. It works just like the UNIX or DOS version. For example,

ftp> cd /pub/systems/msdos

will place you into a directory where files for personal computers running DOS are stored.

To get a listing of the files in the current directory, use the dir or ls command. Unfortunately, it is difficult to give an example as the output will be different depending on what kind of machine you have connected to. Some of the more common systems you will encounter are UNIX systems, IBM mainframes, VAX/VMS systems, or DOS or Windows/NT systems. However, all systems should give you three basic pieces of information: the filename, the size (usually in bytes), and the date that the file was created or updated.

When you are ready to download a file, you will need to set the file transfer mode according to what type of file you are dealing with. See general discussion of file types. The default file transfer format is ASCII. To change to binary file transfer, type the following at the ftp prompt:

ftp> binary

To change back to ASCII file transfer, type the following at the ftp prompt:

ftp> ascii

The two commands that you will be using to transfer files are get and put. The get command "gets"a file from another system and brings it to the system you issued the FTP command from. The put command "puts" a file from the system you issued the FTP command from to another system. It is important to understand these two commands as which one you use depends on what system you issued the FTP command from.

The syntax of the get command is:

ftp> get filename1 filename2

where filename1 is the name of the file on the system you are getting the file from and filename2 is what you want the file to be named when it is transferred to you. If you wish to keep the same filename as filename1 then you do not need to specify filename2.

The syntax of the put command is:

ftp> put filename1 filename2

where filename1 is the name of the file that you are transferring to another system and filename2 is what you want the file to be named when it is transferred from you to the other system. If you wish to keep the same filename as filename1 then you do not need to specify filename2. Note that you must have the ability to write to the directory that you wish to put a file to. For anonymous FTP sites, you typically have read-only access.

When you are done transferring files, you need to close the connection and exit the FTP program. To do this, issue the following commands at the FTP prompt:

ftp> close

ftp> quit

If you have transferred files to Pegasus or some other UNIX based system, be sure to check the file permissions of the transferred files. Sometimes the FTP software may set the permissions such that other users can read the files. For more information on file permissions, see UNIX File Security (File Permissions)

One final thing to note about filenames is that they are case sensitive, which means that upper and lower case letters do make a difference. Keep this in mind when you are specifying filenames for the get and put commands.

In the following three subsections, examples are given for transferring files to and from the Pegasus mail server. These examples can be used a guide for dealing with systems other than Pegasus. Please note, however, due to differences in software and operating systems on other systems, the responses you see may be different.

If you are using a SLIP/PPP connection, you can transfer files to and from your computer by using an FTP client (one comes with the Internet Starter Kit and with Windows 95 and NT). Although the interface is often mouse or menu driven, the same concepts of binary verses text transfer and getting verses putting a file still apply. In this case, you will be using get to transfer files to your computer and put to transfer files from your computer to another system. See the documentation that came with your package for more information on using an FTP client (if one was provided).

If you are issuing the FTP command at the pegasus% prompt:

1. Issue the FTP command:

pegasus% ftp address

where address is the Internet address of the other system to transfer files to/from. When asked, provide the username and password for a valid account on the other system. If you are connecting to a public FTP system, the userid will be anonymous and the password will be your electronic mailing address.

2. If you are transferring files from the mail server to another system, then type the following command:

ftp> put filename1 filename2

where filename1 is the name of the file on the mail server and filename2 is what you want the file to be named when it is transferred to the other system.

3. If you are transferring files from another system to the mail server, then type the following command:

ftp> get filename1 filename2

where filename1 is the name of the file on the other system and filename2 is what you want the file to be named when it is transferred to Pegasus.

Example:

There is a neat program named neatprog.zip located in the directory /pub/systems/msdos at the Internet site wuarchive.wustl.edu. To download this program, do the following:

1. At the pegasus prompt, type the following command:

pegasus% ftp wuarchive.wustl.edu

You will be asked for a username and a password. Respond with a username of anonymous and provide your electronic mailing address for the password.

2. Switch to the directory containing the program:

ftp> cd /pub/systems/msdos

3. Since this program has a filetype of .zip, it is a compressed file and thus needs to be downloaded as binary data. Turn on binary transfer mode as follows:

ftp> binary

4. Now you can download the program:

ftp> get neatprog.zip

5. You now wish to upload one of your own programs so that others on the Internet can use it. Your program is named myprog.exe. Since it is executable code, it must also be transferred using binary mode. You are already in binary mode, so you can just upload the program:

ftp> put myprog.exe

If you are issuing the FTP command at another system's prompt:

1. Issue the FTP command:

ftp pegasus.cc.ucf.edu

When asked, provide your Pegasus userid and password.

2. If you are transferring files from the mail server to another system, then type the following command:

ftp> get filename1 filename2

where filename1 is the name of the file on the mail server and filename2 is what you want the file to be named when it is transferred to the other system.

3. If you are transferring files from another system to the mail server, then type the following command:

ftp> put filename1 filename2

where filename1 is the name of the file on the other system and filename2 is what you want the file to be named when it is transferred to the mail server.

Example:

You are visiting a colleague at another university when you realize that you forgot to print out and bring with you a document stored on your Pegasus account. Your friend has obtained for you a guest account on his school's system so that you can transfer the document (named report.txt) to you and print it out on a local printer. To transfer your document, do the following:

1. Issue the following command at the prompt:

ftp pegasus.cc.ucf.edu

You will be asked for a username and a password. Provide your Pegasus username and password.

2. Since the file you are transferring is a text document, you can use ascii transfer mode, which is the default mode FTP starts with. Transfer the file as follows:

ftp> get report.txt

3. Your friend gave you an interesting document (named info.txt) that you would like to transfer back to your Pegasus account. Transfer the file as follows:

ftp> put info.txt


If you are using your PC LAN account on Computer Services LAN:

1. After you log on to your PC LAN account and type pegasus, you will see a menu. Select the option for transferring files. If you are already logged on to the mail server, then log off and the menu should reappear.

2. If you are transferring files from the mail server to your diskette, then type the following command:

ftp> get filename1 a:filename2

where filename1 is the name of the file on the mail server and filename2 is what you want the file to be named when it is transferred to your diskette (don't forget the a:). Be mindful of DOS's restrictions on filenames: a prefix with a maximum of 8 characters, followed by a period, followed by a suffix (extension) with a maximum of 3 characters. If filename1 does not meet these requirements then be sure to specify a legal DOS filename for filename2.

3. If you are transferring files from your diskette to the mail server, then type the following command:

ftp> put a:filename1 filename2

where filename1 is the name of the file on your diskette (don't forget the a:) and filename2 is what you want the file to be named when it is transferred to the mail server.

Example:

Uh-oh...you log on to your Pegasus account and the system complains that your disk quota has been exceeded. You decide to reduce your disk usage by downloading some mail folders to a diskette. In particular, it looks like your saved-messages folder is getting very large. To download the mail folder, do the following:

1. Log on to your PC LAN account and type pegasus in your LAN temparea or other directory you have write access to. Then select the option for transferring files from the menu.

2. When asked for your username and password, provide your Pegasus username and password.

3. Since the filename saved-messages violates DOS's rules for filenames, you will have to give it another name as it is downloaded:

ftp> get mail/saved-messages a:savemsg.fld

4. Now that you have transferred the mail folder to a diskette, you can log on to your Pegasus account normally, switch to the mail subdirectory and delete the folder:

pegasus% cd mail

pegasus% rm saved-messages

pegasus% cd

TRANSFERRING FILES VIA MODEM

The protocols available for sending a file to or from the mail server via modem are Kermit and ZMODEM. Kermit is a communications protocol developed by Columbia University and is available from Columbia at no charge. ZMODEM is available from many public bulletin boards and FTP sites. If you do not have a copy of Kermit or a software communications package that supports the Kermit protocol, you can get a basic version of Procomm for DOS, which supports Kermit. To do so, have a blank diskette (3 ½" or 5 ¼") ready and log on to your PC LAN account and type dialup. Documentation is included on the disk.

In the following subsections, you will be given two forms of each command: one for text files, and one for binary files. A general discussion of file types. Please note that filenames are case sensitive, which means that upper and lower case letters do make a difference. Keep this in mind when you are specifying filenames for the file transfer commands below.

To transfer a file from the mail server using Kermit:

Quit PINE (<Q>) if you started it. At the pegasus% prompt, issue the following command:

pegasus% kermit -s filename for ascii (text) files

pegasus% kermit -i -s filename for binary (program) files

where filename is the name of the file or mail folder you wish to transfer.

After issuing the Kermit command on the mail server, instruct your communications program to receive the file with the Kermit protocol. Mail folders created with the Save command (<S>) are kept in the "mail"sub directory and must be specified as mail/filename. For example, to transfer your default saved mail folder, which is named "saved-messages,"the command is

pegasus% kermit -s mail/saved-messages

To transfer a file to the mail server using Kermit:

Quit PINE (<Q>) if you started it. At the pegasus% prompt, issue the following command:

pegasus% kermit -r for ascii (text) files

pegasus% kermit -r -i for binary (program) files

After issuing the Kermit command on the mail server, instruct your communications program to send the file with the Kermit protocol. Consult your communications program documentation for further information regarding Kermit file transfers.

To transfer a file from the mail server using ZMODEM:

Quit PINE (<Q>) if you started it. At the pegasus% prompt, issue one the following commands:

pegasus% sz -a filename for ascii (text) files

pegasus% sz -b filename for binary (program) files

where filename is the name of the file or mail folder you wish to transfer. After issuing the transfer command on the mail server, instruct your communications program to receive the file with the ZMODEM protocol. Mail folders created with the Save command (<S>) are kept in the "mail"sub directory and must be specified as mail/filename. For example, to transfer your default saved mail folder, which is named saved-messages, the command is

pegasus% sz -a mail/saved-messages

To transfer a file to the mail server using ZMODEM:

Quit PINE (<Q>) if you started it. At the pegasus% prompt, issue one the following commands:

pegasus% rz -ae for ascii (text) files

pegasus% rz -be for binary (program) files

After issuing the transfer command on the mail server, instruct your communications program to send your file with the ZMODEM protocol.